package com.hsteach.service.buildingApply;

import com.hsteach.common.utils.DateUtils;
import com.hsteach.dao.domain.buildingApply.BuildingApply;
import com.hsteach.dao.mapper.buildingApply.BuildingApplyMapper;
import com.hsteach.enums.ApplyTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 〈〉
 *
 * @author ext.qiufukang1
 * @create 2023/11/21
 * @since 1.0.0
 */
@Service
public class BuildingApplySdkService {

    @Autowired
    private BuildingApplyMapper buildingApplyMapper;

    public Long sumApply(String orgCode) {
        BuildingApply query = new BuildingApply();
        query.setOrgCode(orgCode);
        query.setGtCreateTime(DateUtils.getFirstDayOfMonth(DateUtils.getNowyyyyMMdd()));
        query.setLtCreateTime(DateUtils.getNextFirstDayOfMonth(DateUtils.getNowyyyyMMdd()));
        query.setApplyType(ApplyTypeEnum.BUILDING.getCode());
        return buildingApplyMapper.selectCount(query);
    }
}